/***************************************************************************
 *   CPPSocket - library                                                   *
 *                                                                         *
 *   Copyright (C) 2001 by kuerant (kuerant@gmail.com)                     *
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 *   This library is distributed in the hope that it will be usefull, but  *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      *
 *   Library General Public License for more details.                      *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this library; if not, write to the Free Software   *
 *   Foundation, Inc., 59 Temple Place - Suite 330, Boston,                *
 *   MA 02111-1307, USA                                                    *
 ***************************************************************************/

#ifndef QDXC_EXCEPTION_HPP
#define QDXC_EXCEPTION_HPP

#include <string>
#include <exception>

namespace   QDX {
    namespace   Client {

        /**
         *  baseclass for exceptions used in qdxc-library
         */
        class    Exception : public std::exception
        {
            public    :
                Exception(const std::string& strMessage, int iCode) throw()
                    : m_strMessage(strMessage), m_iCode(iCode)
                {}
                
                virtual ~Exception() throw() {}
                
                const std::string& getMessage() const throw() { return m_strMessage; }
                int                getCode()    const throw() { return m_iCode; }
                
                virtual const char*    what()   const throw() { return m_strMessage.c_str(); }
        
            private    :
                std::string    m_strMessage;
                int    m_iCode;
        };    // class Exception
                
    }   // namespace Client
}   // namespace QDX
#endif  // QDXC_EXCEPTION_HPP

